package model

import business.Destroyable
import org.itheima.kotlin.game.core.Painter

class Blast(override var x: Int, override var y: Int) :IView,Destroyable {
    override var width: Int=Config.block
    override var height: Int=Config.block
    val imagePaths=ArrayList<String>()
    var index:Int=0

    init {
        (1..32).forEach{
            imagePaths.add("img/blast_$it.png")
        }
    }

    override fun draw() {
        val i=index%imagePaths.size
        Painter.drawImage(imagePaths[i],x,y)
        index++
    }

    override fun isDestroy(): Boolean {
        if(index>=imagePaths.size){
            return true
        }
        return false
    }



}